home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / New System Software Extensions / OpenDoc A6 / OpenDoc Parts Framework / OPF / Examples / Text / Include / ValueStream.h < prev   
Encoding:
Text File  |  1994-04-21  |  1.8 KB  |  71 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                            ValueStream.h
  4. //    Release Version:    $ 1.0d1 $
  5. //
  6. //    Author:                        Anthone Burbidge
  7. //    Creation Date:        3/28/94
  8. //
  9. //    Copyright:    © 1993, 1994 by Apple Computer, Inc., all rights reserved.
  10. //
  11. //========================================================================================
  12.  
  13. #ifndef _VALUESTREAM_
  14. #define _VALUESTREAM_
  15.  
  16. // ----- Textension Includes -----
  17.  
  18. #ifndef _Streams_
  19. #include "Streams.h"
  20. #endif
  21.  
  22. //========================================================================================
  23. // Forward class declarations
  24. //========================================================================================
  25.  
  26. class XMPStorageUnit;
  27.  
  28.  
  29. //========================================================================================
  30. // CLASS CValueStream
  31. //========================================================================================
  32.  
  33. class    CValueStream    :    public CStream
  34. {
  35. public:
  36.     CValueStream();
  37.     
  38.     void InitValueStream(XMPStorageUnit *su);
  39.     virtual ~CValueStream();
  40.     
  41.     virtual OSErr WriteBytes(const void* theBytes, long bytesCount);
  42.     virtual OSErr ReadBytes(void* theBytes, long bytesCount);
  43.     
  44.     virtual long GetPosition() const;
  45.     virtual void SetPosition(long newPosition);
  46.     virtual void Skip(long count);
  47.  
  48.     virtual long GetSize() const;
  49.     
  50.     virtual OSErr Append(long count);
  51.         // Appends "count" bytes at the end of the stream, position is not changed
  52.         
  53.     virtual void Empty();
  54.     
  55.     virtual OSErr Load(long size, Ptr* data);
  56.         //fPosition is advanced by "size"
  57.         
  58.     virtual void Unload(Ptr data);
  59.         //should be called even if "Load" returns an error
  60.  
  61. // ----- New API
  62. public:
  63.     XMPStorageUnit *GetStorageUnit()
  64.         { return fSU; }
  65.  
  66. private:
  67.     XMPStorageUnit *fSU;
  68. };
  69.  
  70. #endif
  71.